/*
 * @Author: wangze@linkstec.com
 * @Date: 2022-01-17 09:20:47
 * @Function: Please Input Function
 */
// import Vue from 'vue'

import 'normalize.css/normalize.css';
import ELEMENT from 'element-ui';
import '@/styles/element-variables.scss';
import '@/styles/index.scss';
import App from './App.vue';
import router from './router';
import store from './store';
import i18n from './i18n';
import api from './api';
import VueRouter from 'vue-router';

// 自定义组件全局引入 - 不包含业务组件（/components/businessComponents/）,业务组件按需引入
import '@/components';
// 全局filter引入
import './utils/filter';

import { isIE } from './utils/browser';

import Directives from './directives/index';
Vue.use(Directives);

// 在升级了Vue-Router版本到到3.1.0及以上之后，页面在跳转路由控制台会报Uncaught (in promise)的问题。
const originalPush = VueRouter.prototype.push;
VueRouter.prototype.push = function push (location, resolve, reject) {
    if (resolve || reject) return originalPush.call(this, location, resolve, reject);
    return originalPush.call(this, location).catch((e) => { });
};

if (isIE()) {
  document.documentElement.classList.add('is-ie');
}

Vue.prototype.$api = api;

Vue.use(ELEMENT, {
  size: 'medium'
});

Vue.config.productionTip = false;

new Vue({
  router,
  i18n,
  store,
  render: h => h(App)
}).$mount('#app');
